import request from '@/utils/request';
import qs from 'qs';
// 生产统计模块接口
// 历史轨迹实时数据
export function getHistoryTrackData(query) {
  return request({
    url: '/historicalData/historicalTrack/employmentHistoryData',
    method: 'GET',
    params: query,
    paramsSerializer: params => {
      return qs.stringify(params, { indices: false });
    }
  });
}
// 用工历史记录
export function getHistoricalEmployment(query) {
  return request({
    url: '/historicalData/workers/employmentHistoryData',
    method: 'GET',
    params: query,
    paramsSerializer: params => {
      return qs.stringify(params, { indices: false });
    }
  });
}
// 历史数据查询
export function getHistoricalData(query) {
  return request({
    url: '/productionFigures/queryHistoricalWorkersData',
    method: 'POST',
    data: query
  });
}
// 历史数据导出
export function exportHistoricalData() {
  window.open(
    `${localStorage.getItem(
      'baseURL'
    )}productionFigures/exportHistoricalWorkersData`,
    '_blank'
  );
}
